﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace DataProvider
{
    [Serializable]
    public class SageField: SageEntity
    {
        public SageField()
        {
        }

        public SageField(string file, FieldInfo info, SageVersion version): base()
        {
            Namespace = info.DeclaringType.Namespace;
            Type = info.DeclaringType.Name;
            Name = info.Name;
            IsStatic = info.IsStatic;
            IsPublic = info.IsPublic;
            IsStatic = info.IsStatic;
            Assembly = Path.GetFileName(file);
            VersionId = version.Id;
        }

        public override string ToString()
        {
            return string.Format("{0}.{1}::{2}", Namespace, Type, Name);
        }
    }
}
